﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />
<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <%@ include file="/WEB-INF/include/menu.jsp"%>

  <div class="container main-content">

    <div class="panel panel-default x-panel x-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/ecommerce">电商管理</a></li>
          <li class="active">产品分类</li>
        </ol>
      </div>

      <div class="panel-body">

        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

        <div class="col-xs-10 x-panel-layout-right">

          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire" title="产品分类"></i>&nbsp;&nbsp;<span>产品分类&nbsp;-&nbsp;分类列表</span></h2>
          </div>
          <div class="row">
            <div class="col-xs-4" style="padding-left: 0px; padding-right: 0px;">
              <c:forEach var="productType" items="${enums['productType']}" step="3" begin="0">
                <div class="col-xs-12 product-category">
                  <div class="panel panel-default denver-panel denver-panel-layout">
                    <div class="panel-heading">
                      <span>${productType.description}</span>
                    </div>
                    <ul class="list-group">
                      <c:forEach var="category" items="${productCategories[productType.name]}">
                        <li class="list-group-item">
                          <span>${category.name}</span>
                          <a href="${ctx.host}/product-categories/${category.id}/delete" data-target="#delete" data-toggle="modal" class="pull-right"><i class="glyphicon glyphicon-remove"></i></a>
                          <a href="${ctx.host}/product-categories/${category.id}/edit" data-target="#edit" data-toggle="modal" ：class="pull-right" style="right: 30px;"><i class="glyphicon glyphicon-edit"></i></a>
                        </li>
                      </c:forEach>
                    </ul>
                    <div class="panel-footer text-center">
                      <a href="${ctx.host}/product-categories/create?type=${productType.alias}" class="hover-no-text-decoration" data-target="#create" data-toggle="modal"><i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;添加新类别</a>
                    </div>
                  </div>
                </div>
              </c:forEach>
            </div>
            <div class="col-xs-4" style="padding-left: 0px; padding-right: 0px;">
              <c:forEach var="productType" items="${enums['productType']}" step="3" begin="1">
                <div class="col-xs-12 product-category">
                  <div class="panel panel-default denver-panel denver-panel-layout">
                    <div class="panel-heading">
                      <span>${productType.description}</span>
                    </div>
                    <ul class="list-group">
                      <c:forEach var="category" items="${productCategories[productType.name]}">
                        <li class="list-group-item">
                          <span>${category.name}</span>
                          <a href="${ctx.host}/product-categories/${category.id}/delete" data-target="#delete" data-toggle="modal" class="pull-right"><i class="glyphicon glyphicon-remove"></i></a>
                          <a href="${ctx.host}/product-categories/${category.id}/edit" data-target="#edit" data-toggle="modal" ：class="pull-right" style="right: 30px;"><i class="glyphicon glyphicon-edit"></i></a>
                        </li>
                      </c:forEach>
                    </ul>
                    <div class="panel-footer text-center">
                      <a href="${ctx.host}/product-categories/create?type=${productType.alias}" class="hover-no-text-decoration" data-target="#create" data-toggle="modal"><i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;添加新类别</a>
                    </div>
                  </div>
                </div>
              </c:forEach>
            </div>
            <div class="col-xs-4" style="padding-left: 0px; padding-right: 0px;">
              <c:forEach var="productType" items="${enums['productType']}" step="3" begin="2">
                <div class="col-xs-12 product-category">
                  <div class="panel panel-default denver-panel denver-panel-layout">
                    <div class="panel-heading">
                      <span>${productType.description}</span>
                    </div>
                    <ul class="list-group">
                      <c:forEach var="category" items="${productCategories[productType.name]}">
                        <li class="list-group-item">
                          <span>${category.name}</span>
                          <a href="${ctx.host}/product-categories/${category.id}/delete" data-target="#delete" data-toggle="modal" class="pull-right"><i class="glyphicon glyphicon-remove"></i></a>
                          <a href="${ctx.host}/product-categories/${category.id}/edit" data-target="#edit" data-toggle="modal" ：class="pull-right" style="right: 30px;"><i class="glyphicon glyphicon-edit"></i></a>
                        </li>
                      </c:forEach>
                    </ul>
                    <div class="panel-footer text-center">
                      <a href="${ctx.host}/product-categories/create?type=${productType.alias}" class="hover-no-text-decoration" data-target="#create" data-toggle="modal"><i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;添加新类别</a>
                    </div>
                  </div>
                </div>
              </c:forEach>
            </div>
          </div>

          <jsp:include page="/WEB-INF/include/page.jsp">
            <jsp:param name="url" value="products" />
            <jsp:param name="queryString" value="${queryString}" />
          </jsp:include>

        </div>
      </div>
    </div>
  </div>

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource root="${ctx.resource}/build" type="script" src="js/page/ecommerce/product/category/category-list.js">
    <script type="text/javascript">
      require(['page/ecommerce/product/category/category-list'],function(page){
          page.init();
      })
    </script>
  </d:resource>
</body>

</html>
